home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Behavior Library.cst / 00044_UI Pointer Change.ls < prev    next >
Encoding:
Text File  |  1997-05-09  |  3.9 KB  |  99 lines

  1. -- Pointer Change
  2.  
  3.  
  4. -- Changes the stage cursor for the movie, add to any sprite on stage.
  5. -- handles ChangeCursor and RestoreCursor messages
  6.  
  7. property  pointerStyle,  CustomImage, CustomMask, currentPointer
  8. property  Rpointerstyle, RCustomImage, RCustomMask
  9.  
  10. property useCustom, useCustomR -- boolean, tru if use custom cursor art for cursor and/or restored cursor
  11.  
  12. property changeBegin, changeEnd
  13.  
  14. on beginSprite me
  15.   if changeBegin then
  16.     changecursor me  
  17.   end if
  18.   
  19. end
  20.  
  21. on EndSprite me  
  22.   if changeEnd then
  23.     restorecursor me  
  24.   end if
  25. end
  26.  
  27. on ChangeCursor me
  28.   set currentPointer = translate_cursor( me, pointerStyle, customImage, customMask, useCustom )
  29.   cursor( currentPointer )
  30. end
  31.  
  32. on restoreCursor me
  33.   set currentPointer = translate_cursor( me, RpointerStyle, RcustomImage, RcustomMask, useCustomR  )
  34.   cursor( currentPointer )
  35. end
  36.  
  37. on translate_cursor me, setting, image, mask, custom
  38.   if custom then
  39.     set val = [ member image, member mask ]
  40.     return val
  41.   end if
  42.   return setting
  43. end
  44.  
  45.  
  46.  
  47. ---
  48.  
  49. on getPropertyDescriptionList
  50.   
  51.   set p_list = [ ┬¼
  52.   #changeBegin: [ #comment:    "Change Pointer on BeginSprite:", ┬¼
  53.                     #format:   #boolean, #default:false], ┬¼
  54.   #changeEnd: [ #comment:      "Restore Pointer on EndSprite:", ┬¼
  55.                     #format:   #boolean, #default:false], ┬¼
  56.   #pointerStyle: [ #comment:   "Pointer Image:", ┬¼
  57.                     #format:   #cursor, #default: 1], ┬¼
  58.   #useCustom: [ #comment:      "Use Custom Pointer Image:", ┬¼
  59.                     #format:   #boolean, #default:false], ┬¼
  60.   #customImage: [ #comment:    "Custom Image:", ┬¼
  61.                     #format:   #bitmap, ┬¼
  62.                    #default:    member 1 ], ┬¼
  63.     #customMask: [ #comment:   "Custom Mask:", ┬¼
  64.                     #format:   #bitmap, ┬¼
  65.                    #default:    member 1 ], ┬¼
  66.   #RpointerStyle: [ #comment:  "Restored Pointer Image:", ┬¼
  67.                     #format:   #cursor, #default:1], ┬¼
  68.   #useCustomR: [ #comment:     "Restore Custom Pointer Image:", ┬¼
  69.                     #format:   #boolean, #default:false], ┬¼
  70.   #RcustomImage: [ #comment:   "Restored Custom Image:", ┬¼
  71.                     #format:   #bitmap, ┬¼
  72.                    #default:    member 1 ], ┬¼
  73.     #RcustomMask: [ #comment:  "Restored Custom Mask:", ┬¼
  74.                     #format:   #bitmap, ┬¼
  75.                    #default:    member 1 ] ┬¼
  76.   ]
  77.   return p_list  
  78. end
  79.  
  80. on getBehaviorDescription
  81.   return ┬¼
  82. "Changes the pointer image to one of the pointers included with Director, or to a  1-bit bitmapped castmember. Attach the behavior to a sprite or place it in the script channel." & RETURN & ┬¼
  83. "PARAMETERS:" & RETURN & ┬¼
  84. "ΓÇó Change on BeginSprite - Turn this option on to change the pointer in the frame where the sprite begins."  & RETURN & ┬¼
  85. "ΓÇó Change on EndSprite - Turn this option on to restore the pointer in the frame after the sprite ends."  & RETURN & ┬¼
  86. "ΓÇó Pointer - Choose one of Director's included pointers."  & RETURN & ┬¼
  87. "ΓÇó Use Custom - Turn this option on to use a cast member for a pointer instead of one of Director's included pointers."  & RETURN & ┬¼
  88. "ΓÇó Custom Image  - ( optional ) Choose which cast member to use as a pointer image. This setting is ignored if Use Custom isn't on."  & RETURN & ┬¼
  89. "ΓÇó Custom Mask - ( optional ) Choose a cast member to use as a mask image." & RETURN & ┬¼
  90. "ΓÇó Restored Pointer - Choose one of Director's included pointers to be displayed when the sprite ends."  & RETURN & ┬¼
  91. "ΓÇó Restore Custom - Turn this option on to display a cast member when the sprite ends."  & RETURN & ┬¼
  92. "ΓÇó Restored Custom Image  - ( optional ) Choose a cast member to display as the pointer image when the sprite ends."  & RETURN & ┬¼
  93. "ΓÇó Restored Custom Mask - ( optional ) Choose a cast member to use as a mask image when the sprite ends.  " & RETURN & ┬¼
  94. "MESSAGES:" & RETURN & ┬¼
  95. "ΓÇó ChangeCursor - Changes the pointer to the specified image."  & RETURN & ┬¼
  96. "ΓÇó RestoreCursor - Restores the original pointer image."
  97.   
  98. end
  99.